<template>
  <div class="app-container">
    <el-row :gutter="20" type="flex" justify="center" align="middle">
      <el-col :span="20" :xs="24"  style="background-color: rgb(6, 26, 72);border: 1px solid #0c1e4b;padding: 30px 40px 30px 40px">
      <!-- 添加或修改对话框 -->
      <el-form ref="form":model="form" :rules="rules" label-width="80px" >
        <el-row v-loading="loading">
          <div style="text-align: center;padding-bottom: 3%;font-size: 20px;font-weight:900;color:#5DCBFF">
            <span>滤池参数配置</span>
          </div>
          <el-col :span="12">
            <el-form-item label="滤料年限" prop="llsynx">
              <el-input v-model="form.llsynx" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="滤格流量" prop="sjll">
              <el-input v-model="form.sjll" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="滤格含泥率" prop="hnl">
              <el-input v-model="form.hnl" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="滤格膨胀率" prop="pzl">
              <el-input v-model="form.pzl" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="滤格面积" prop="lgmj">
              <el-input v-model="form.lgmj" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="设备总数" prop="sbzs">
              <el-input v-model="form.sbzs" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="反洗滤层测评" prop="fxlccp">
              <el-input v-model="form.fxlccp" />
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
        <div class="dialog-footer" style="text-align: center;padding-top:2%">
        <el-button type="primary" @click="submitForm">设置滤池参数</el-button>
      </div>
      </el-col>
    </el-row>
    </div>
</template>
<script>
import "@/assets/styles/robt-bg.css";
import {getInfo,addlvparam} from "@/api/nssc/lvparam/lcparam";
export default {
  data() {
    return {
      // 遮罩层
      loading: true,
      // 表单参数
      form: { },
      id:undefined,
      device_id:undefined,
      inspection_point_id:undefined,
      ratio:undefined,
      resize:undefined,
      calibration:undefined,
      other:undefined,
      // 表单校验
      rules: { }
    };
  },
  //初始化配置
  created() {
    this.getInfo();
  },
  methods: {
    /** 查询配置 */
    getInfo() {
      this.loading = true;
      getInfo().then(response => {
        this.form = response.data;
        this.loading = false;
      });
    }, //表单重置
    reset() {
      this.resetForm("form");
    },
    /** 提交按钮 */
    submitForm: function() {
      this.$refs["form"].validate(valid => {
         if (valid) {
           addlvparam(this.form).then(response => {
              this.$modal.msgSuccess("参数设置成功！");
              this.getInfo();
            });
         }
      });
    }
  }
};
</script>
